<template>
  <!-- ... 其他模板代码 ... -->
  <el-form>
  <el-form-item label="停机计划时间段：" class="timerange">
    <el-date-picker
      @change="changeValue"
      v-model="valuePicker"
      type="datetimerange"
      start-placeholder="开始日期"
      end-placeholder="结束日期"
      value-format="yyyy-MM-dd HH:mm:ss"
      :default-time="['00:00:00', '23:59:59']"
      :disabled="selectedQueryType === '01'"
      :picker-options="pickerOptions"
      align="right"
      unlink-panels
    >
    </el-date-picker>
  </el-form-item>
  </el-form>
  <!-- ... 其他模板代码 ... -->
</template>


<script>
export default {
 
 
 
 data() {
    return {
        selectedQueryType:"",
      valuePicker:'' ,
      pickerOptions: {
  onPick: ({ maxDate, minDate }) => {
    this.minDate = minDate;
    this.maxDate = maxDate;
  },
  disabledDate: (time) => {
    if (this.minDate && this.maxDate) {
      const startOfDay = new Date(this.minDate.getFullYear(), this.minDate.getMonth(), this.minDate.getDate(), 0, 0, 0);
      const endOfDay = new Date(this.maxDate.getFullYear(), this.maxDate.getMonth(), this.maxDate.getDate(), 23, 59, 59);
      return time < startOfDay || time > endOfDay;
    }
    return false;
  }
},

 
}
},
methods:{
changeValue(e){
 if(e===null){
   this.valuePicker=''
  this.minDate=''
  this.maxDate=''
 }
}
}
 
 
 
 
 

 

  

};
</script>
